﻿using System.Data;

namespace SportStore.Core.Data
{
    /// <summary>
    /// Defines generic unit of work interface.
    /// </summary>
    public interface IUnitOfWork
    {
        /// <summary>
        /// Begins a transaction.
        /// </summary>
        IGenericTransaction BeginTransaction();

        /// <summary>
        /// Begins a transaction with an isolation level.
        /// </summary>
        IGenericTransaction BeginTransaction(IsolationLevel isolationLevel);

        /// <summary>
        /// Flushes changes to the database.
        /// </summary>
        void Flush();

        /// <summary>
        /// Clears the current session.
        /// </summary>
        void Clear();
    }
}
